import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Node {
	Map<Character, Node> children = new HashMap<>();
	boolean isEndOfWord = false;
}

class Trie {

	private Node root;

	public Trie() {
		root = new Node();
	}

	public void insert(String word) {
		Node curr = root;
		for (int i = 0; i < word.length(); i++) {
			char c = word.charAt(i);
			Node node = curr.children.get(c);
			if (node == null) {
				node = new Node();
				curr.children.put(c, node);
			}
			curr = node;
		}
		curr.isEndOfWord = true;
	}

	public int countNodes() {
		return countNodes(root);
	}

	private int countNodes(Node node) {
		int count = 1;
		for (Node child : node.children.values()) {
			count += countNodes(child);
		}
		return count;
	}

}

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Trie trie = new Trie();

		while (scanner.hasNextLine()) {
			String word = scanner.nextLine();
			trie.insert(word);
		}

		System.out.println(trie.countNodes());

	}

}
